import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/system/menu/userMenu`,
			name: "获取我的菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/system/menu/list`,
			name: "获取菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		edit: {
			url: `${config.API_URL}/system/menu/edit`,
			name: "菜单编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/system/menu/delete`,
			name: "菜单编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		}
	},
	dic: {
		tree: {
			url: `${config.API_URL}/system/dict/typeList`,
			name: "获取字典类型",
			get: async function(){
				return await http.get(this.url);
			}
		},
		typeEdit: {
			url: `${config.API_URL}/system/dict/typeEdit`,
			name: "字典类型编辑",
			post: async function(data) {
				return await http.post(this.url, data);
			}
		},
		typeDelete: {
			url: `${config.API_URL}/system/dict/typeDelete`,
			name: "字典类型删除",
			post: async function(data) {
				return await http.post(this.url, data);
			}
		},
		list: {
			url: `${config.API_URL}/system/dict/dataList`,
			name: "字典数据列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		dataEdit: {
			url: `${config.API_URL}/system/dict/dataEdit`,
			name: "字典数据编辑",
			post: async function(data) {
				return await http.post(this.url, data);
			}
		},
		dataDelete: {
			url: `${config.API_URL}/system/dict/dataDelete`,
			name: "字典数据型删除",
			post: async function(data) {
				return await http.post(this.url, data);
			}
		},
		dataDeletes: {
			url: `${config.API_URL}/system/dict/dataDeletes`,
			name: "字典数据型批量删除",
			post: async function(data) {
				return await http.post(this.url, data);
			}
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	role: {
		list: {
			url: `${config.API_URL}/system/role/list`,
			name: "获取角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/system/role/edit`,
			name: "角色编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		permission: {
			url: `${config.API_URL}/system/role/permission`,
			name: "角色权限",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		roleMenu: {
			url: `${config.API_URL}/system/role/roleMenu`,
			name: "获取角色菜单",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	usergroup: {
		list: {
			url: `${config.API_URL}/system/usergroup/list`,
			name: "获取用户分组列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/system/usergroup/edit`,
			name: "用户分组编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		}
	},
	user: {
		list: {
			url: `${config.API_URL}/system/user/list`,
			name: "获取用户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/system/user/edit`,
			name: "用户编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		resetpassword: {
			url: `${config.API_URL}/system/user/resetpassword`,
			name: "重置用户密码",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		modifypassword: {
			url: `${config.API_URL}/system/user/modifypassword`,
			name: "修改密码",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		modifyUser: {
			url: `${config.API_URL}/system/user/modifyuser`,
			name: "修改个人信息",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/system/user/delete`,
			name: "用户删除",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
	},
	app: {
		list: {
			url: `${config.API_URL}/system/app/list`,
			name: "应用列表",
			get: async function(){
				return await http.get(this.url);
			}
		}
	},
	log: {
		loginList: {
			url: `${config.API_URL}/system/logger/login/list`,
			name: "登录日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		operList: {
			url: `${config.API_URL}/system/logger/oper/list`,
			name: "操作日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		operInfo: {
			url: `${config.API_URL}/system/logger/oper/info`,
			name: "操作日志详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		userOper: {
			url: `${config.API_URL}/system/logger/oper/user`,
			name: "管理员操作日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		systemList: {
			url: `${config.API_URL}/system/logger/system/list`,
			name: "系统日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	},
	table: {
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	resource: {
		list: {
			url: `${config.API_URL}/system/resource`,
			name: "文件管理列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/system/resource`,
			name: "文件编辑",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/system/resource`,
			name: "文件删除",
			delete: async function(data){
				return await http.delete(this.url, data);
			}
		},
	}
}
